#include <iostream>
using namespace std;
#include<cstdio>
typedef long long ll;
int main()
{
	ll n=0;
	cin >> n;
	ll s[n]={0};
  	ll a[n]={0}; 
  	ll i,j,sum=0;
	for(i=0;i<n;i++)
	{
		cin >> a[i] ;
	}
	for(i=0;i<n;i++)
	{
		for(j=i+1;j<n;j++)
		{
			s[i]+=a[i]*a[j];
		}
		sum+=s[i];
	}
	cout << sum << endl;
	return 0;
 } 
